<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basepath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>二级区域详情信息</title>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <meta content="black" name="apple-mobile-web-app-status-bar-style" />
    <meta content="telephone=no" name="format-detection" />
    <link href="<%=basepath%>css/index.css" rel="stylesheet" type="text/css">
    <link href="<%=basepath%>css/platform.css" rel="stylesheet" type="text/css">
    <script src="<%=basepath%>js/jquery-1.8.3.min.js"></script>
    <script src="<%=basepath%>js/layer/layer.js"></script>
</head>
<body>
<div class="viewport">
    <div class="header">
       <div class="header-1">
           <a href="javascrpt:void(0)" id="join" class="header-2">
              <span id="account" class="account">${empty user.realName ? '' : user.realName}</span>&nbsp;&nbsp;<span id="deptName" class="deptName">${user.departmentName}</span>
           </a>
           <a href="/wape-web/api/core/centerService?serviceCode=WJ9999&targetURL=store&prefix=3g_platform_shop-rent_op&entrance=yes" class="back" id="back">返回</a>
           <span class="span-num">WMP31200</span>
       </div>
    </div>
    <div class="content m-top">
        <div class="content-1">
            <div class="content-1-1">
                <img alt="粤西农批" src="<%=basepath%>images/mmzs.png" class="img-1">
            </div>
            <div class="content-1-2"><h3>粤西农副产品综合交易中心</h3></div>
        </div>
    </div>
    <div class="blank-2"></div>
    <div class="content-3">
        <div class="content-3-1">
            <span class="span-3">${market.fatherName}</span>
        </div>
    </div>
    <div class="content-4">
        <div class="content-4-1">
            <span class="span-3">${market.storeName}</span>
        </div>
        <div class="blank-1"></div>
        <div class="content-4-2">
            <span class="span-3">经营品类：<span>
	            <c:if test="${market.storeType == '10'}">大棚经营区</c:if>
	            <c:if test="${market.storeType == '20'}">蔬菜经营区</c:if>
	            <c:if test="${market.storeType == '30'}">水果经营区</c:if>
	            <c:if test="${market.storeType == '40'}">海鲜经营区</c:if>
	            <c:if test="${market.storeType == '50'}">冻品经营区</c:if>
	            <c:if test="${market.storeType == '60'}">干货经营区</c:if>
	        </span></span>
        </div>
        <div class="blank-1"></div>
        <div class="content-4-2">
            <span class="span-3">区域面积：<span>${market.totalArea}</span> m²</span>
        </div>
        <div class="blank-1"></div>
        <div class="content-4-2">
            <span class="span-3">商铺数量：<span>${market.storeRemark}</span>个商铺</span>
        </div>
        <div class="blank-1"></div>
        <div class="content-4-2">
            <span class="span-3">自营车位数量：<span>${market.packingCount}</span>个</span>
        </div>
    </div>
    <div class="blank-2"></div>
    <div class="content-3">
        <div class="content-3-1">
            <span class="span-4">二级区域其他信息</span>
        </div>
    </div>
    <div class="content-4">
        <c:forEach items="${prop}" var="po">
            <div class='layout3-2-1'><a href='javascript:void(0)' id='${po.storePropId}' class='a4-2'><span style='float:left;' class='text'>${po.propValue}</span><img alt='' src='<%=basepath%>images/b43.png' style='float:right;width:40px;'></a></div><div class='hr'></div>
        </c:forEach>
        <div class="content-4-1" style="text-align:center;" id="other2"><a href="javascript:void(0)" id="other" style="font-size:20px;width:100%;display:inline-block;">✚</a></div>
    </div>
</div>
</body>
<script type="text/javascript">
    /*错误提示*/
    $(function(){
        var error = "${requestScope.returnMsg}";
        if(error != "" && error != "成功!"){
            layer.msg(error,{shadeClose:true,shade:0.1,time:2000});
        }
    });
    $(function(){
    	/*  */
        $(document).on('click','.a4-2',function(){
            var title3 = $(this).children(".text");
            var spid = $(this).attr("id");
            layer.prompt({formType:0,title:"二级区域其他信息"},function(index2){
                layer.load();
                layer.closeAll();
                title3.text(index2);
                 $.ajax({
	                 type:"post",
	                 url:"/wape-web/api/core/centerService",
	                 data:{
	                	  serviceCode:"MMZS21106",
	                	  storePropId:spid,
	                	  propName:index2,
	                	  propValue:index2
	                 },
	                 success:function(data){
	                 var add2 = eval("("+data+")");
	                 if(add2.returnCode == "200"){
	                 title3.text(index2);
	                 }
	                 else{
	                 layer.msg(add2.returnMsg,{shadeClose:true,shade:0.1,time:2000});
	                 }
	                 }
                 }); 
            });
        });
    	/*添加*/
        $("#other").click(function(){
            layer.prompt({formType:0,title:"添加二级区域其他信息"},function(index3){
                if(index3 != ""){
                	layer.load();
                	var storeId = '${market.storeId}';
                    layer.closeAll();
                    $.ajax({
                        type:"post",
                        url:"/wape-web/api/core/centerService",
                        data:{
                            serviceCode:"MMZS21105",
                            storeId:storeId,
                            propName:index3,
                            propValue:index3
                        },
                        success:function(data){
                            var add3 = eval("("+data+")");
                            var spid = add3.result.storePropId;
                            if(add3.returnCode == "200"){
                            	layer.closeAll();
                            	$("#other2").before("<div class='layout3-2-1'><a href='javascript:void(0)' id='" + spid + "' class='a4-2'><span style='float:left;' class='text'>"+index3+"</span><img alt='' src='<%=basepath%>images/b43.png' style='float:right;width:40px;'></a></div><div class='hr'></div>");
                            }
                            else{
                            	layer.closeAll();
                                layer.msg(add3.returnMsg,{shadeClose:true,shade:0.1,time:2000});
                            }
                        }
                    });
                }

            });
        });
    });
</script>
</html>
